package cn.tedu.review;
/**用于OOP的回顾*/
public class TestCar {
    public static void main(String[] args) {
        Car c=new Car();
        /*c.brand="宝马";
        c.color="活力橙";
        c.price=20000.98D;
        c.length=3.1D;
        System.out.println(c.brand);
        System.out.println(c.color);
        System.out.println(c.price);
        System.out.println(c.length);*/
        c.setBrand("特斯拉");
        c.setColor("石墨绿");
        c.setPrice(21000.99);
        c.setLength(2.9);
        c.star();
//        c.stop();
        System.out.println(c.getBrand());
        System.out.println(c.getColor());
        System.out.println(c.getPrice());
        System.out.println(c.getLength());


    }
}
class Car{
    private String brand;
    private String color;
    private Double price;
    private Double length;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getLength() {
        return length;
    }

    public void setLength(Double length) {
        this.length = length;
    }

    public void star(){
        System.out.println("汽车启动");
        stop();
    }
    private void stop(){
        System.out.println("汽车停止");
    }
}